package com.dubbo.register;

import com.dubbo.register.zk.ZkUtils;
import sun.net.util.IPAddressUtil;

import java.net.URL;

public class RemoteRegister
{
    private static RemoteRegister remoteRegister = new RemoteRegister();

    private RemoteRegister()
    {

    }

    public static RemoteRegister getInstance()
    {
        return remoteRegister;
    }

    final static String PATH = "/dubbo02/";
    static ZkUtils zkUtils= new ZkUtils();

    public void put(String key, URL url)
    {
        zkUtils.put(PATH + key, url);
    }

    public URL get(String key)
    {
        return (URL)zkUtils.getObj(PATH+key);
    }
}
